package com.cmc.cloud.cmclink.doc.api.document.rep;

import com.cmc.cloud.cmclink.doc.api.document.emums.ExImTypeEnum;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.*;
import org.apache.commons.lang3.StringUtils;
import org.hibernate.validator.constraints.Length;

import javax.validation.Valid;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

/**
 * @author 周贤
 * @date 2025/11/08
 */
@Schema(description = "管理后台 - 提单主信息创建 Request VO")
@Data
@EqualsAndHashCode()
@AllArgsConstructor
@NoArgsConstructor
@ToString()
@Valid
public class BlnoFobReqDto {
    @Schema(description = "提单号", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 50, message = "{blno.blno.length}")
    private String blNo;
    @Schema(description = "船名代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 50, message = "{blnovslvoy.vesselcode.length}")
    private String vesselCode;

    @Schema(description = "出口航次", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 50, message = "{blnovslvoy.voyageex.length}")
    private String voyageEx;

    @Schema(description = "装货港代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 5, message = "{blnovslvoy.polcode.length}")
    private String polCode;

    @Schema(description = "进口航次", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 50, message = "{blnovslvoy.voyageim.length}")
    private String voyageIm;

    @Schema(description = "卸货港代码", requiredMode = Schema.RequiredMode.REQUIRED)
    @Length(max = 5, message = "{blnovslvoy.podcode.length}")
    private String podCode;
    @Schema(description = "Cargo Type")
    Set<String> cargoTypeList;
    @Schema(description = "Cntr Type")
    Set<String> cntrTypeList;
    @Schema(description = "Payment Term")
    Set<String> paymentTermList;
    @Schema(description = "chargeCode Item")
    Set<String> chargeCodeList;
    @Schema(description = "booking Party")
    Map<String, String> bookingPartyMap;
    @Schema(description = "booking Party 请求")
    List<String> bookingPartyList;
    @Schema(description = "blno Status")
    Map<String, String> splitCombineStatusMap;
    @Schema(description = "blno Status 请求")
    List<String> splitCombineStatusList;
    @Schema(description = "place of receipt 主")
    Set<String> porList;
    @Schema(description = "place of delivery 主")
    Set<String> delList;
    @Schema(description = "place of loading 当前航段")
    Set<String> polList = new HashSet<>(16);
    @Schema(description = "place of discharge 当前航段")
    Set<String> podList = new HashSet<>(16);
    @Schema(description = "cntr Status")
    Set<String> cntrStatusList;
    @Schema(description = "space Owner")
    Set<String> spaceOwnerList;
    @Schema(description = "cntr Owner")
    Set<String> cntrOwnerList;
    @Schema(description = "top Agent")
    Map<String, String> topAgentMap;
    @Schema(description = "top Agent 请求")
    List<String> topAgentList;
    @Schema(description = " Include Local Charge")
    boolean includeLocalCharge;
    @Schema(description = "进出口类型")
    String exImType;

    public String getExImType() {
        return StringUtils.isNotEmpty(getVoyageEx()) ? ExImTypeEnum.EX.getValue() : ExImTypeEnum.IM.getValue();
    }


}
